<template>
  <div class="panel-4 card-common-cls" :class="{'mask-cls': maskable}" @click="click2Drag">
    <div class="panel-4-pic">
      <div class="panel-4-pic-avatar">
        <img :src="item.avatar_url || `${env.publicPath}images/default-head.png`" alt="">
      </div>
      <img v-if="item.flag_url" :src="item.flag_url" alt="">
    </div>
  </div>
</template>

<script>
  export default {
    props: {
      item: Object,
      maskable: {
        type: Boolean,
        default: true,
      },
    },
    methods: {
      click2Drag() {
        // console.log(e);
      },
    },
  }
</script>

<style lang="scss" scoped>
  .mask-cls::before {
    position: absolute;
    content: '';
    width: 100%;
    height: 100%;
    z-index: 999;
  }

  .card-common-cls {
    position: relative;
    width: 100%;
    max-width: 375px;
    z-index: 0;

    display: flex;
    justify-content: center;
    align-items: center;

    .panel-4-pic {
      position: relative;
      width: 100px;
      height: 100px;

      display: flex;
      justify-content: center;
      align-items: center;

      .panel-4-pic-avatar {
        width: 80px;
        height: 80px;
        border-radius: 40px;
        overflow: hidden;

        >img {
          display: block;
          width: 100%;
          height: 100%;
          object-fit: cover;
        }
      }

      >img {
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 20px;
        z-index: 1;
      }
    }
  }
</style>
